package sunstar.com.xq.util

import android.app.Dialog
import android.content.Context
import android.view.View
import android.widget.ProgressBar
import com.github.ybq.android.spinkit.style.CubeGrid
import com.github.ybq.android.spinkit.style.FoldingCube
import sunstar.com.xq.R

/**
 * Created by Sun.Star on 2017/6/7.
 */
class DialogUtil (context:Context){
    private var dialog : Dialog? = null
    init {
        dialog = Dialog(context, R.style.dialogWithNoColor)
        var view = View.inflate(context,R.layout.dialog_view,null)
        dialog!!.setContentView(view)
        (view.findViewById(R.id.base_progress) as ProgressBar).setIndeterminateDrawable( CubeGrid())
    }
    fun show(){
        dialog!!.show()
    }
    fun dismiss(){
        if(dialog!=null&&dialog!!.isShowing){
            dialog!!.dismiss()
        }
    }
}


